﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace ITS.Core.Domain.Users
{
    public class User
    {
        private ICollection<Role> _roles;
        [Key]
        [ForeignKey("UserExtended")]
        public Guid UserID { get; set; }
        public string UserName { get; set; }
        public DateTime LastActivityDate { get; set; }
        public string Password { get; set; }
        public bool IsApproved { get; set; }
        public bool IsLockedOut { get; set; }
        public DateTime CreateDate { get; set; }
        public DateTime LastLoginDate { get; set; }
        public DateTime LastPasswordChangedDate { get; set; }
        public DateTime LastLockoutDate { get; set; }
        public string Comment { get; set; }

        public virtual UserExtended UserExtended { get; set; }
        public virtual ICollection<Role> Roles
        {
            get { return _roles ?? (_roles = new List<Role>()); }
            protected set { _roles = value; }
        }
    }
    
}
